home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / lib / mathlib / psort / README < prev   
Encoding:
Text File  |  1994-08-02  |  3.1 KB  |  58 lines

  1. /* ****************************************************************************
  2. *                                          *
  3. * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.              *
  4. * All Rights Reserved.                                  *
  5. *                                          *
  6. * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;      *
  7. * the contents of this file may not be disclosed to third parties, copied or  *
  8. * duplicated in any form, in whole or in part, without the prior written      *
  9. * permission of Silicon Graphics, Inc.                          *
  10. *                                          *
  11. * RESTRICTED RIGHTS LEGEND:                              *
  12. * Use, duplication or disclosure by the Government is subject to restrictions *
  13. * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data      *
  14. * and Computer Software clause at DFARS 252.227-7013, and/or in similar or    *
  15. * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -     *
  16. * rights reserved under the Copyright Laws of the United States.          *
  17. *                                          *
  18. *******************************************************************************
  19. *                                          *
  20. *    PSORT written by                              *
  21. *                Jean-Pierre Panziera                  *
  22. *                            jpp@corp.sgi.com      *
  23. *                                          *
  24. *******************************************************************************
  25. *                                          *
  26. *    PSORT is Parallel implementation of the Merge-Sort Algorithm.          *
  27. *                                                                             *
  28. *       There are two versions of the library:                                *
  29. *             mp_mips1/libpsort.a     will run on all platforms              *
  30. *             mp_mips2/libpsort.a     will run on R4000 machines              *
  31. *                                          *
  32. *    Sub-arrays of doubling size are iteratively merge together,          *
  33. *    until the whole array is sorted.                      *
  34. *    Hence at each of the Log(N) steps N/2, N/4, N/8 ... 1 Merge(s)           *
  35. *    are performed independantly.                          *
  36. *    To  get even more parallelism, the final Merges    are split into          *
  37. *    independant submerges                              *
  38. *                                          *
  39. *    The "psort" calling sequence is the same as for the C Library "qsort" *
  40. *                                          *
  41. *    psort( base, nel, size, compar)                          *
  42. *                                          *
  43. *    base:    array of elements to be sorted,                      *
  44. *    nel:    number of elements to be sorted,                  *
  45. *    size:    size of each element in byte,                      *
  46. *    compar: pointer to a function that compare 2 elements.              *
  47. *        compar takes 2 pointers to elements as arguments           *
  48. *           and returns an integer. The integer returned is:          *
  49. *            < 0 if first element is smaller than the second          *
  50. *               == 0 if first element is equivallent to  the second,   *
  51. *            > 0 if first element is larger than the second.          *
  52. *                                          *
  53. *                                                                             *
  54. *       NOTE:  To use PSORT, you must have Power C installed on your          *
  55. *              workstation.                                                   *
  56. *                                                                             *
  57. **************************************************************************** */
  58.